//
//  PhotoPageView.h
//  Malena
//  
//  Created by Dawn on 12-3-1.
//  Copyright 2012 Dawn. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol PhotoPageViewDelegate;
@interface PhotoPageView : UIView<UIScrollViewDelegate> {
@private
	UIScrollView *photoScrollView;
    NSMutableArray *imagesArray;
	NSInteger page;
	CGSize photoViewSize;
	NSInteger photoCount;
    NSArray *photoFiles;
    BOOL isScaled;
	id delegate;
    NSTimer *timer;
    BOOL pageEnabled;
    UIImageView *currentImageView;
}
@property (nonatomic,retain) NSArray *photoFiles;						// 图片源
@property (nonatomic,assign) id<PhotoPageViewDelegate> delegate;        // delegate
@property (nonatomic) NSInteger page;									// 当前页
@property (nonatomic,readonly) NSString *currentPhotoUrl;				// 返回当前图片的URL string
@property (nonatomic,readonly) UIImage *currentImage;

- (id)   initWithFrame:(CGRect)frame files:(NSArray *)files;            // 初始化函数
- (void) reloadDataWith:(NSArray *)urls;
- (void) pageToIndex:(NSInteger)index;
- (void) pageToIndex:(NSInteger)index animated:(BOOL)animated;
- (void) quickPageToIndex:(NSInteger)index;
- (void) startAutoScroll;
- (void) stopAutoScroll;
@end

@protocol PhotoPageViewDelegate
@optional
// 翻页
- (void) photoPageView:(PhotoPageView *)pageView didPagedToIndex:(NSInteger)index;
// 选择
- (void) photoPageView:(PhotoPageView *)pageView didSelectedAtIndex:(NSInteger)index;
// 缩放
- (void) didZoomToScale:(float)scale;
@end
